package com.huike.report.mapper;

import java.util.List;
import java.util.Map;

import com.huike.report.domain.vo.DragonTigerList;
import com.huike.report.domain.vo.VulnerabilityMapVo;
import org.apache.ibatis.annotations.Param;

/**
 * 首页统计分析的Mapper
 *
 * @author Administrator
 */
public interface ReportMapper {
    /**=========================================基本数据========================================*/
    /**
     * 获取线索数量
     *
     * @param beginCreateTime 开始时间
     * @param endCreateTime   结束时间
     * @param username        用户名
     * @return
     */
    Integer getCluesNum(@Param("startTime") String beginCreateTime,
                        @Param("endTime") String endCreateTime,
                        @Param("username") String username);

    /**
     * 获取商机数量
     *
     * @param beginCreateTime 开始时间
     * @param endCreateTime   结束时间
     * @param username        用户名
     * @return
     */
    Integer getBusinessNum(@Param("startTime") String beginCreateTime,
                           @Param("endTime") String endCreateTime,
                           @Param("username") String username);

    /**
     * 获取合同数量
     *
     * @param beginCreateTime 开始时间
     * @param endCreateTime   结束时间
     * @param username        用户名
     * @return
     */
    Integer getContractNum(@Param("startTime") String beginCreateTime,
                           @Param("endTime") String endCreateTime,
                           @Param("username") String username);

    /**
     * 获取合同金额
     *
     * @param beginCreateTime 开始时间
     * @param endCreateTime   结束时间
     * @param username        用户名
     * @return
     */
    Double getSalesAmount(@Param("startTime") String beginCreateTime,
                          @Param("endTime") String endCreateTime,
                          @Param("username") String username);

    /**
     * =========================================今日简报========================================
     */

    Integer getToDayCluesNum(String userName);

    Integer getToDayBusinessNum(String userName);

    Integer getTodayContractNum(String userName);

    Double getTodaySaleAmount(String userName);

    /**
     * =========================================待办========================================
     */


    //学科客户分布饼图
    List<Map> selectSubjectStatistics(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    /**
     * ==========================待办数据统计==========================
     **/

    Integer getTofollowedCluesNum(@Param("userName") String userName, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getTofollowedBusinessNum(@Param("userName") String userName, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getToallocatedCluesNum(@Param("userName") String userName, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getToallocatedBusinessNum(@Param("userName") String userName, @Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);


    //查询每天的线索数量
    List<Map> getCountByDay(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    //漏斗图
    VulnerabilityMapVo getVulnerabilityMapVo(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    //商机转合同龙虎榜
    List<DragonTigerList> getBusinessChangeStatistics(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    List<DragonTigerList> getSalesStatistic(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getSalesStatisticSum(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);
}
